//
//  BaseTableViewController.swift
//  CZWeiBo06
//
//  Created by Mac on 15/8/14.
//  Copyright (c) 2015年 Mac. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController,VisitorLoginDelegate{
    
    
    var isUserLogin : Bool = false
    
    var visitorView : VisitorLoginView?
    
    override func loadView() {
        
        if isUserLogin == true {
            
            super.loadView()
            return
        }
        
        visitorView = NSBundle.mainBundle().loadNibNamed("VisitorLoginView", owner: nil, options: nil).last as? VisitorLoginView
        
        view = visitorView
    }
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        visitorView?.delegate = self
        
      
        
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: Selector("didVisitorViewRegiest"))
         self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: Selector("didVisitorViewLogin"))
        
    }
    
    func didVisitorViewLogin() {
        
        println("登录")
    }
    
    
    func didVisitorViewRegiest() {
        
        println("注册")
        
    }
    
}
